# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

_pyname=pysmt
pkgname=python-${_pyname}
pkgver=0.9.5
pkgrel=2
pkgdesc='Solver-agnostic library for SMT Formulae manipulation and solving'
url='https://github.com/pysmt/pysmt'
license=('Apache')
arch=('any')
depends=('python' 'python-z3-solver')
makedepends=('python-build' 'python-installer' 'python-wheel' 'python-setuptools')
checkdepends=('python-pytest')
source=("${url}/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz")
sha512sums=('d1e3b4f9f7bc90c15ddcfbcf87e4d487acff9613ae48d56a91bd83ab1c929af8c15ced29f6b097a599f91b41bbfadcf89e4601edba2bdff36c80c41b7c5165bb')
b2sums=('0716c6b5e66a50072947f2e959ab5dfd92494b4d9bb92a11cf6250e9b8a9940591a64af0382e173230da31fd7d7178904da9bd4d424ab53ee217ccc49186234a')

build() {
  cd ${_pyname}-${pkgver}
  export EXTRA_CFLAGS="${CFLAGS} ${CPPFLAGS}"
  python -m build --wheel --no-isolation
}

check() {
  cd ${_pyname}-${pkgver}
  PYTHONPATH=build/lib pytest -k 'not test_z3_back_formulae'
}

package() {
  cd ${_pyname}-${pkgver}
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dm 644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -Dm 644 README.rst -t "${pkgdir}/usr/share/doc/${pkgname}"
  cp -r examples "${pkgdir}/usr/share/doc/${pkgname}"
}

# vim: ts=2 sw=2 et:
